# -*- coding: utf-8 -*-
from __future__ import annotations
import os
from agent import run_agent

def _has_key() -> bool:
    return bool(os.getenv("DEEPSEEK_API_KEY")) or os.getenv("MOCK_LLM") == "1"

def test_sum():
    if not _has_key():
        print("跳过：未配置 DEEPSEEK_API_KEY（或未启用 MOCK_LLM=1）。")
        return
    out = run_agent("2+3是多少？")
    assert "5" in out, f"unexpected output: {out}"
    print("case1 ok:", out)

def test_chitchat():
    if not _has_key():
        print("跳过：未配置 DEEPSEEK_API_KEY（或未启用 MOCK_LLM=1）。")
        return
    out = run_agent("今天天气不错，用一句话夸夸我")
    assert len(out) > 0
    print("case2 ok:", out)

if __name__ == "__main__":
    test_sum()
    test_chitchat()
